<!--#
layout("/layouts/platform.html"){
#-->
<header class="header navbar bg-white shadow">
    <div class="btn-group tool-button">
        <a class="btn btn-primary navbar-btn" href="${base}/platform/msg/info" id="goBack" data-pjax><i class="ti-angle-left"></i>${msg['globals.button.back']}</a>
    </div>
</header>

<div class="content-wrap">
    <div class="wrapper" style="min-height:500px;">
        <section class="panel panel-form">
            <form id="editForm" role="form" class="form-horizontal parsley-form" data-parsley-validate
                  action="${base}/platform/msg/info/editDo" method="post">
                <input name="id" type="hidden" value="${obj.id}">
                <div class="row mb10 mt10">
                    <div class="col-lg-12">
                        <div class="form-group">
                            <label for="name" class="col-sm-2 control-label">${msg['msg.info.column.name']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="name" class="form-control" name="name" data-parsley-required="true"
                                       placeholder="${msg['msg.info.column.name']}" value="${obj.name}" >
                            </div>
                        </div>
                      <!-- <div class="form-group">
                            <label for="nameCode" class="col-sm-2 control-label">${msg['msg.info.column.nameCode']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="nameCode" class="form-control" name="nameCode" data-parsley-required="true"
                                       placeholder="${msg['msg.info.column.nameCode']}" value="" readonly>
                            </div>
                        </div>-->
                       <!-- <div class="form-group">
                            <label for="supportMSG" class="col-sm-2 control-label">${msg['msg.info.column.supportMSG']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="supportMSG" class="form-control" name="supportMSG" data-parsley-required="true"
                                       placeholder="${msg['msg.info.column.supportMSG']}" value="${obj.supportMSG}" >
                            </div>
                        </div>-->
                       <!-- <div class="form-group">
                            <label for="disabledMSG" class="col-sm-2 control-label">${msg['msg.info.column.disabledMSG']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="disabledMSG" class="form-control" name="disabledMSG" data-parsley-required="true"
                                       placeholder="${msg['msg.info.column.disabledMSG']}" value="${obj.disabledMSG}" >
                            </div>
                        </div>-->
                        <div class="form-group">
                            <label for="supportMSG" class="col-sm-2 control-label">${msg['msg.info.column.supportMSG']}</label>
                            <div class="col-sm-8 switcha">
                                <div class="mr15">
                                    <input type="checkbox" id="supportMSG"  class="js-switch-blue" <!--#if(obj.supportMSG){#-->checked<!--#}#-->>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="supportSMS" class="col-sm-2 control-label">${msg['msg.info.column.supportSMS']}</label>
                            <div class="col-sm-8 switcha">
                                <div class="mr15">
                                    <input type="checkbox" id="supportSMS"  class="js-switch-blue" <!--#if(obj.supportSMS){#-->checked<!--#}#-->>
                                </div>
                            </div>
                        </div>
                        <!--<div class="form-group">
                            <label for="disabledSMS" class="col-sm-2 control-label">${msg['msg.info.column.disabledSMS']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="disabledSMS" class="form-control" name="disabledSMS" data-parsley-required="true"
                                       placeholder="${msg['msg.info.column.disabledSMS']}" value="${obj.disabledSMS}" >
                            </div>
                        </div>-->
                      <!--  <div class="form-group">
                            <label for="disabledSMS" class="col-sm-2 control-label">${msg['msg.info.column.disabledSMS']}</label>
                            <div class="col-sm-8 switcha">
                                <div class="mr15">
                                    <input type="checkbox" id="disabledSMS" name="disabledSMS" class="js-switch-blue" &lt;!&ndash;#if(obj.disabledSMS){#&ndash;&gt;checked&lt;!&ndash;#}#&ndash;&gt;>
                                </div>
                            </div>
                        </div>-->
                        <div class="form-group">
                            <label for="supportEmail" class="col-sm-2 control-label">${msg['msg.info.column.supportEmail']}</label>
                            <div class="col-sm-8 switcha">
                                <div class="mr15">
                                    <input type="checkbox" id="supportEmail" class="js-switch-blue" <!--#if(obj.supportEmail){#-->checked<!--#}#-->>
                                </div>
                            </div>
                        </div>
                       <!-- <div class="form-group">
                            <label for="supportEmail" class="col-sm-2 control-label">${msg['msg.info.column.supportEmail']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="supportEmail" class="form-control" name="supportEmail" data-parsley-required="true"
                                       placeholder="${msg['msg.info.column.supportEmail']}" value="${obj.supportEmail}" >
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="disabledEmail" class="col-sm-2 control-label">${msg['msg.info.column.disabledEmail']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="disabledEmail" class="form-control" name="disabledEmail" data-parsley-required="true"
                                       placeholder="${msg['msg.info.column.disabledEmail']}" value="${obj.disabledEmail}" >
                            </div>
                        </div>-->
                       <!-- <div class="form-group">
                            <label for="disabledEmail" class="col-sm-2 control-label">${msg['msg.info.column.disabledEmail']}</label>
                            <div class="col-sm-8 switcha">
                                <div class="mr15">
                                    <input type="checkbox" id="disabledEmail" name="disabledEmail" class="js-switch-blue" &lt;!&ndash;#if(obj.disabledEmail){#&ndash;&gt;checked&lt;!&ndash;#}#&ndash;&gt;>
                                </div>
                            </div>
                        </div>-->
                        <div class="form-group">
                            <label for="location" class="col-sm-2 control-label">${msg['msg.info.column.location']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="location" class="form-control" name="location" data-parsley-required="true"
                                       placeholder="${msg['msg.info.column.location']}" value="${obj.location}" >
                            </div>
                        </div>
                       <!-- <input type="hidden" name="supportMSG"  value="${obj.supportMSG}">
                        <input type="hidden" name="supportSMS"  value="${obj.supportSMS}">
                        <input type="hidden" name="supportEmail" value="${obj.supportEmail}">-->
                    </div>
                </div>
                <div class="col-lg-3"></div>
                <div class="col-lg-6">
                    <div class="form-group text-center">
                        <label></label>
                        <div>
                            <button class="btn btn-primary btn-block btn-lg btn-parsley" data-loading-text="${msg['globals.button.submit.tip']}">${msg['globals.button.submit']}</button>
                        </div>
                    </div>
                </div>
            </form>
        </section>

    </div>
</div>
<script language="JavaScript">
    $(document).ready(function () {
        myForm.init();
        $('#editForm').ajaxForm({
            dataType: 'json',
            beforeSubmit: function (arr, form, options) {
                var supportMSGValue = $("#supportMSG:checked");
                if(supportMSGValue.length > 0){
                    var supportMSG ={
                        name: "supportMSG",
                        required: false,
                        value: true
                    }
                    arr.push(supportMSG);
                }else{
                    var supportMSG ={
                        name: "supportMSG",
                        required: false,
                        value: false
                    }
                    arr.push(supportMSG);
                }

                var supportEmailValue = $("#supportEmail:checked");
                if(supportEmailValue.length > 0){
                    var supportEmail ={
                        name: "supportEmail",
                        required: false,
                        value: true
                    }
                    arr.push(supportEmail);
                }else{
                    var supportEmail ={
                        name: "supportEmail",
                        required: false,
                        value: false
                    }
                    arr.push(supportEmail);
                }

                var supportSMSValue = $("#supportSMS:checked");
                if(supportSMSValue.length > 0){
                    var supportSMS ={
                        name: "supportSMS",
                        required: false,
                        value: true
                    }
                    arr.push(supportSMS);
                }else{
                    var supportSMS ={
                        name: "supportSMS",
                        required: false,
                        value: false
                    }
                    arr.push(supportSMS);
                }

                form.find("button:submit").button("loading");
            },
            success: function (data, statusText, xhr, form) {
                if (data.code == 0) {
                    Toast.success(data.msg);
                    setTimeout(function () {
                        $("#goBack").trigger("click");
                    }, 1000);
                } else {
                    Toast.error(data.msg);
                }
                form.find("button:submit").button("reset");
            }
        });
    });
</script>
<!--#}#-->